package com.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * AccpSubjectitems entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ACCP_SUBJECTITEMS", schema = "ACCP")
public class AccpSubjectitems implements java.io.Serializable {

	// Fields

	private Integer id;
	private AccpSubject accpSubject;
	private String zhang;
	private String zhangjiexuhao;
	private String dirname;
	private Set<AccpTask> accpTasks = new HashSet<AccpTask>(0);
	private Set<AccpHomework> accpHomeworks = new HashSet<AccpHomework>(0);
	private Set<AccpVote> accpVotes = new HashSet<AccpVote>(0);

	// Constructors

	/** default constructor */
	public AccpSubjectitems() {
	}

	/** minimal constructor */
	public AccpSubjectitems(Integer id) {
		this.id = id;
	}

	/** full constructor */
	public AccpSubjectitems(Integer id, AccpSubject accpSubject, String zhang,
			String zhangjiexuhao, String dirname, Set<AccpTask> accpTasks,
			Set<AccpHomework> accpHomeworks, Set<AccpVote> accpVotes) {
		this.id = id;
		this.accpSubject = accpSubject;
		this.zhang = zhang;
		this.zhangjiexuhao = zhangjiexuhao;
		this.dirname = dirname;
		this.accpTasks = accpTasks;
		this.accpHomeworks = accpHomeworks;
		this.accpVotes = accpVotes;
	}

	// Property accessors
	@Id
	@Column(name = "ID", unique = true, nullable = false, precision = 8, scale = 0)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SUBID")
	public AccpSubject getAccpSubject() {
		return this.accpSubject;
	}

	public void setAccpSubject(AccpSubject accpSubject) {
		this.accpSubject = accpSubject;
	}

	@Column(name = "ZHANG")
	public String getZhang() {
		return this.zhang;
	}

	public void setZhang(String zhang) {
		this.zhang = zhang;
	}

	@Column(name = "ZHANGJIEXUHAO")
	public String getZhangjiexuhao() {
		return this.zhangjiexuhao;
	}

	public void setZhangjiexuhao(String zhangjiexuhao) {
		this.zhangjiexuhao = zhangjiexuhao;
	}

	@Column(name = "DIRNAME", length = 333)
	public String getDirname() {
		return this.dirname;
	}

	public void setDirname(String dirname) {
		this.dirname = dirname;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpSubjectitems")
	public Set<AccpTask> getAccpTasks() {
		return this.accpTasks;
	}

	public void setAccpTasks(Set<AccpTask> accpTasks) {
		this.accpTasks = accpTasks;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpSubjectitems")
	public Set<AccpHomework> getAccpHomeworks() {
		return this.accpHomeworks;
	}

	public void setAccpHomeworks(Set<AccpHomework> accpHomeworks) {
		this.accpHomeworks = accpHomeworks;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpSubjectitems")
	public Set<AccpVote> getAccpVotes() {
		return this.accpVotes;
	}

	public void setAccpVotes(Set<AccpVote> accpVotes) {
		this.accpVotes = accpVotes;
	}

}